package 面向对象;

import java.util.Arrays;

/*
 *
 *面向对象三大特征：封装、继承、多态
 *
 * */
public class 使用面向对象打印数组 {
    public static void main(String[] args) {
        int[] array = new int[]{10, 20, 30, 40};
        //面向过程
        System.out.println("面向过程");
        System.out.print("[");
        for (int i = 0; i < array.length - 1; i++) {
            System.out.print(array[i] + ",");

        }
        System.out.print(array[array.length - 1]);
        System.out.println("]");
        System.out.println("面向对象");
        System.out.println(Arrays.toString(array));
    }
}
